package basis.ioc;

/**
 * 工厂模式创建实例
 */
public class VehicleFactory {

    public static basis.ioc.IVehicle createIVehicle(String name) {
        try {
            return (basis.ioc.IVehicle) Class.forName(name).
                    getConstructor()
                    .newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
